package com.example.web.service.cabinetstatus.impl;

import com.example.web.constant.CouponType;
import com.example.web.service.CouponStrategy;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service(CouponType.PRICE_BREAK)
public class PriceBreakDiscountsCouponStrategyImpl extends CouponStrategy {
    @Override
    public BigDecimal calculate(BigDecimal input) {
        if (input.compareTo(BigDecimal.valueOf(10L)) > 0) {
            return input.subtract(BigDecimal.valueOf(1L));
        }
        return input;
    }
}
